import { request } from '@boeyo/portal';

export const getTerminalList = async (params: any) => {
  return request({
    url: '/edgeInfo/list',
    method: 'GET',
    params,
  });
};

/**
 * 下载模板
 * null
 */
export const downloadTemplate = (data) => {
  return request({
    url: '/edgeInfo/downloadTemplate',
    method: 'POST',
    responseType: 'blob',
    data,
  });
};

/**
 * 导入模板预览
 * @ss.hasPermi('edgeInfo:import')
 */
export const importData = (data) => {
  return request({
    url: '/edgeInfo/importData',
    method: 'POST',
    data,
  });
};

/**
 * 设备导入
 * @ss.hasPermi('edgeInfo:importBatch')
 */
export const importBatch = (data) => {
  return request({
    url: '/edgeInfo/importBatch',
    method: 'POST',
    data,
  });
};

/**
 * 删除边缘终端
 * @ss.hasPermi('edgeInfo:remove')
 */
export const deleteEdgeInfo = (ids: number[]) => {
  return request({
    url: `/edgeInfo/delete/${ids}`,
    method: 'DELETE',
  });
};

/**
 * 修改边缘终端
 * @ss.hasPermi('edgeInfo:update')
 */
export const updateEdgeInfo = (data) => {
  return request({
    url: '/edgeInfo/update',
    method: 'PUT',
    data,
  });
};
